/**
 * @file    drv_flash.h
 * @brief   flash驱动
 * @author  Liuwei
 * @version 1.0.1
 * @date    2023-04-21
 * 
 * @copyright Copyright (c) 2023 JBD-Energy Storage Technology Co. LTD
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version   <th>Author   <th>Description
 * <tr><td>2023-04-21 <td>1.0.1     <td>Liuwei   <td>首次创建
 * </table>
 */

#ifndef __DRV_FLASH_H_
#define __DRV_FLASH_H_

/* file includes -------------------------------------------------------------*/
#include "mcu_type.h"
/* cplusplus -----------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif

/* macro/define/typedef ------------------------------------------------------*/
/* @brief */

/* variables -----------------------------------------------------------------*/

/*******************************************************************************
 * public API List
 ******************************************************************************/
void drv_flash_init(void);
uint8_t drv_flash_erase_area(uint32_t start_addr , uint32_t end_addr);
void drv_flash_read_data(uint32_t addr , uint8_t *buf , uint32_t size);
uint8_t drv_flash_write_data(uint32_t addr , uint8_t *buf , uint32_t size);
void drv_flash_close(void);
uint8_t drv_flash_verify_data(uint32_t start_addr, uint32_t end_addr , uint8_t *buf);
void drv_flash_wr_test(void);

#ifdef __cplusplus
}
#endif

#endif  /* #ifndef __DRV_FLASH_H_ */
/********** Copyright (c) 2023 JBD-Energy Storage Technology Co. LTD *********/



